package org.adorsys.aderp.aderplogin.security.token;

import java.util.HashMap;
import java.util.Map;

import org.springframework.stereotype.Service;

@Service("tokenRoleAssociationStore")
public class InMemoryTokenRoleAssociationStore implements TokenRoleAssociationStore {
	private Map<String, String> store = new HashMap<String, String>();
	
	@Override
	public String getSelectedRole(String token) {
		return store.get(token);
	}

	@Override
	public void setSelectedRole(String token, String role) {
		store.put(token, role);
	}

	@Override
	public String removeSelectedRole(String token) {
		return store.remove(token);
	}

}
